package generic10;

class Point
{
	private Object x;
	private Object y;
	public Point()
	{
		
	}
	public Point(Object x,Object y)
	{
		this.setX(x);
		this.setY(y);
	}
	public void setX(Object x)
	{
		this.x = x;
	}
	public void setY(Object y)
	{
		this.y = y;
	}
	public Object getX()
	{
		return this.x;
	}
	public Object getY()
	{
		return this.y;
	}
	public String toString()
	{
		return "X的坐标是："+this.getX()+",y的坐标是："+this.getY();
	}
	
}
public class GenericDemo01
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		Class<?> c1 = null;
		Point point = null;
		try
		{
			c1 = Class.forName("generic10.Point");
		}
		catch(ClassNotFoundException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        try
		{
			 point = (Point)c1.newInstance();
		}
		catch(InstantiationException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch(IllegalAccessException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		point.setX(3);
		point.setY(4);
		System.out.print(point.toString());
		
	}

}
